package com.Mt.Mager.Contorller;

import com.Mt.Dto.Dto;
import com.Mt.Service.MtInviteService;
import com.Mt.Utils.DtoUtil;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("invite")
public class MtInviteController {

    @Reference
    private MtInviteService mtInviteService;

    // 分页查询
    @PostMapping("page")
    public Dto page(@RequestBody Map<Object,Object> param){
        String userId = param.get("userId").toString();
        int index = Integer.parseInt(param.get("index").toString());
        return DtoUtil.returnSuccessData(mtInviteService.page(userId,index));
    }
}
